/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:张熳
 * Date:2025-08-29
 * Time:7:52
 */
//内部类
//匿名内部类

//匿名内部类实现接口
interface IWalk {
    void walk();
}

//匿名内部类继承抽象类
abstract class Shape {
    public abstract void draw();
}

public class OutClass4 {
    public void InnerClass4() {
        IWalk iWalk = new IWalk() {
            @Override
            public void walk() {
                System.out.println("🦆正在地面走路~");
            }
        };
        iWalk.walk();
    }

    public void InnerClass5() {
        Shape shape = new Shape() {
            @Override
            public void draw() {
                System.out.println("花一朵❀~");
            }
        };
        shape.draw();
    }
}
